home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Oct 89 / Z0024-Segment Mapping-Oct89 < prev    next >
Encoding:
Text File  |  1989-10-09  |  2.6 KB  |  90 lines  |  [TEXT/GEOL]

  1. Item    0893345                         6-Oct-89        21:19
  2.  
  3. From:   V0230                           Trace, Laurence Kirsh,VAR
  4.  
  5. To:     KNEPPER                         Knepper, Christopher
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Segment Mapping
  10.  
  11. Chris,
  12.  
  13. Yes, the linker's segment mappings are useful. You reminded me of a script I
  14. have to extract all of the -sn's from a MacApp MakeIt file. I have listed it
  15. below, in case it would be of any use to anyone.
  16.  
  17. What I was thinking of when I wrote the note was the job of getting each method
  18. into the "right" segment. Of course, there aren't THAT many segments, and after
  19. a while you remember which methods go into which segments. Still, MacApp
  20. development could stand a lot of automation.
  21.  
  22. For example, wouldn't it be great if your method overrides went into the
  23. inherited method's segment automatically? Wouldn't it be great if Fields
  24. methods were created automatically? Wouldn't it be great if the compiler knew
  25. which Toolbox routine did NOT move memory, so it wouldn't flag the parameters
  26. as "in danger"?....ah, well.
  27.  
  28. Here is my script to produce a legible listing of segment mappings from a
  29. MacApp MakeIt file. Put it in a file, and simply execute it:
  30.  
  31.  
  32. ######################################################
  33. # 'SN Stripper'
  34. # A simple script to change link synonyms from a
  35. #  "MakeIt" file into a legible list of the same.
  36. #
  37. # If there are any linker options in the middle of the list of
  38. # -sn options (usually caused by adding -sn options to your own
  39. # MAMake file) they should just go along for the ride.
  40. # If they cause errors, rearrange them in your MAMake file.
  41.  
  42. set MISuffix "-sn" #our new file's suffix
  43.  
  44. #get makeit file, open it as target (we won't save changes)
  45. set Exit 0
  46. unset MIFile
  47. set MIFile `GetFileName -t TEXT -m "Select a MakeIt file"` ≥ Dev:Null
  48. if {Status} != 0
  49.    set Exit 1
  50.    echo "Script Cancelled"
  51.    exit
  52. end
  53. open -t "{MIFile}"
  54.  
  55. #delete all through first Link -sn
  56. find •
  57. find /∂"Linking:/
  58. find /∂-sn /
  59. clear §:•
  60.  
  61. #find last -sn, delete everything after it, add final CR
  62. find -c ∞ /-sn/
  63. find /=[A-Za-z0-9]+/Δ  #check for more characters?
  64. clear §:∞
  65. replace § "∂n"
  66.  
  67. #break each -sn onto a separate line, remove any ∂s
  68. find •
  69. replace -c ∞ / ∂-sn / ∂n
  70. find •
  71. replace -c ∞ /[ ∂t]*∂∂/ ""
  72.  
  73. #swap "G" names on left of "=" with "A" names on right:
  74. find •
  75. replace -c ∞ /(≈)®1∂=(≈)®2∂n/ '®2=®1'∂n
  76.  
  77. #sort by "G" names
  78. sort "{Target}" > "{MIFile}{MISuffix}"
  79.  
  80. #close original file WITHOUT saving changes, open new one, resize it
  81. close -n "{Target}"
  82. open -t "{MIFile}{MISuffix}"
  83. sizewindow 230 305
  84.  
  85. Set Exit 1
  86. ###############################################
  87.  
  88. -John MacVeigh
  89.  
  90.